// XenRender.h
#pragma once
#pragma comment(lib, "dxguid.lib")

#include <d3d9.h>
#include <d3dx9.h>
#include <direct.h>
#include "../Local.h"
#include "../XenMemory/XenMemory.h"
#include "../XenInfo/XenInfo.h"
#include "../XenStats/XenStats.h"
#include "../XenItemSniffer/XenItemSniffer.h"
#include "../XenMap/XenMap.h"
#include "../Input.h"
#include "../DBAccess.h"
#include "../FPCamera/FPCamera.h"


class XenRender
{
private:
	XenMemory *xenMemory;
	XenInfo *xenInfo;
	XenStats *xenStats;
#ifndef LITE
	XenMap *xenMap;
	XenItemSniffer *xenItemSniffer;
#endif
	
	IDirect3DDevice9 *pIDirect3DDevice9;

	int screenWidth;
	int screenHeight;

	//Camera
	/*D3DXMATRIX viewMatrix;
	CFPCamera *gCamera;
	bool moveCam;*/

	D3DXFONT_DESC fVersion;
	LPD3DXFONT versionFont;

	static bool fastClick;
	static bool detached;

	static long WINAPI ProcessFastClick(void *param);

	void ProcessInput();
	void TakeScreenShotDC(const char* fileName);
	void SaveBitmap(const char *szFilename, HBITMAP hBitmap);

public:
	static bool created;
	//static MyGUI::Gui* mGUI;
	//static MyGUI::DirectXPlatform* mPlatform;

	XenRender() {}
	XenRender(IDirect3DDevice9 *pIDirect3DDevice9);

	void setupResources();

	void Initialize();

	void Render();
	void TestCam();

	void Release();
};

int ReadMemLocUInt(int address);